home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’93 / Inside Mac Movie Toolbox Code / mtb6.c < prev    next >
Text File  |  1992-10-22  |  947b  |  40 lines

  1. //    Copyright:    © 1992 by Apple Computer, Inc., all rights reserved.
  2.  
  3. #include "mtb.h"
  4.  
  5. void CreateMyCoolMovie (void)
  6. {
  7.     Point             where = {100,100};
  8.     SFReply            theSFReply;
  9.     Movie             theMovie = nil;
  10.     FSSpec             mySpec;
  11.     short             resRefNum = 0;
  12.     short             resId = 0;
  13.     OSErr             err = noErr;
  14.  
  15.     SFPutFile (where, "\pEnter movie file name:", 
  16.                             "\pMovie File", nil, &theSFReply);
  17.     if (!theSFReply.good) return;  
  18.  
  19.     FSMakeFSSpec(theSFReply.vRefNum, 0,
  20.                                      theSFReply.fName, &mySpec);
  21.  
  22.     err = CreateMovieFile (        &mySpec, 
  23.                                 'TVOD',
  24.                                 smCurrentScript, 
  25.                                 createMovieFileDeleteCurFile,
  26.                                 &resRefNum, 
  27.                                 &theMovie );
  28.     CheckError(err, "\pCreateMovieFile");
  29.  
  30.     CreateMyVideoTrack (theMovie);
  31.     CreateMySoundTrack (theMovie);
  32.     
  33.     err = AddMovieResource (theMovie, resRefNum, &resId,
  34.                                          theSFReply.fName);
  35.     CheckError(err, "\pAddMovieResource");
  36.     
  37.     if (resRefNum) CloseMovieFile (resRefNum);
  38.     DisposeMovie (theMovie);
  39. }
  40.